package com.blb.dslock_demo.zk;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ProductController {

    @Resource
    private ProductService productService;

    @GetMapping("/reduce-stock/{id}")
    public String reduce(@PathVariable Long id) throws Exception {
        productService.reduceStock(id);
        return "ok";
    }
}
